<?php
	if(isset($_GET['uid'])&&intval($_GET['uid'])>0)
	{
		$uid=intval($_GET['uid']);
	}
	else
	{
		if($logid!=false)
			$uid=$logid;
		else
			edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
	}
?>
<div class="main_box">
    	<div class="left_bar">
        <div class="order_box">
            <ul class="orange_menu">
            
                 <li><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type=1')?>" <?php if($type=='1') echo 'class="tab_show"';?> >店铺</a></li>
                 <li><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type=2')?>" <?php if($type=='2') echo 'class="tab_show"';?> >商品</a></li>
                 <li><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type=3')?>" <?php if($type=='3') echo 'class="tab_show"';?> >评单</a></li>    
                                                
             </ul>
        </div>         
            
  <?php
	switch($type)
	{    
		 case '1':
	 	{
  ?>	 	
	
            <div class="colt_box">
			<div class="colt_title"><?php secho($user); ?>的店铺收藏(<?php echo $itemCount; ?>)</div>
            	
            <?php  
            
                if($itemList)
                {
                	foreach($itemList as $shop)
                	{                	
            ?>	
            	<div class="colt_item">
                	
                	<div class="colt_left">
                        <dl><dt><a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>"><img src="<?php echo $shop['logo_url'];?>" width="80" height="80" class="item_list_pic_shop"/></a></dt></dl>
                    </div>
                	<div class="colt_right"> 	  
                	  <div class="colt_right_box">  
					   <div class="colt_shop_title"><a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id']);?>"><?php secho( $shop['shop_name'] ); ?></a> (<?php echo $shopDAO->GetShopPlatform($shop['plat_id']);?>)</div>
                        	<div class="colt_shop">							
                            	<div class="point_box">         
                            		<span class="score<?php echo getScoreClass($shop['score']);?>"></span>
                                </div>
                                <h2>宝贝真实度</h2><h3><?php echo $shop['reality'];?></h3>
                                <h2>性价比</h2><h3><?php echo $shop['rate'];?></h3>
                                <h2>服务态度</h2><h3><?php echo $shop['service'];?></h3>
                                <h2>发货速度</h2><h3><?php echo $shop['velocity'];?></h3>
                        	</div>                         	                           
                            <div class="colt_shop_edit">
                            	<h1><span>添加于 <?php echo  substr($shop['collect_date'],0,10);?></span></h1>
                            	
                            	<h2><a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO,'sid='.$shop['id'].'#ar');?>">发表点评</a></h2>
                            
                            	<h2>
								<?php
									if($logid && $logid==$uid){
								?>
									 <a name="<?php echo $shop['id'].'_'.$shop['shop_name'];?>" class="modify_shop" href="#">编辑</a>
								<?php
									}else{
								?>
									 <a name="<?php echo $shop['id'].'_'.$shop['shop_name'];?>" class="add_shop" href="#">收藏</a>
								<?php
									}
								?>                            	
                            	</h2>
                            </div>
                      </div>
                  </div>
       		  </div>
       		  
		<?php  			
			}}
		?>			  
          </div>          
  <?php 
		
			break;
		}
  
		 case '2':
	 	{
  ?>        
           
		    <div class="colt_box">
			<div class="colt_title"><?php echo $user;?>的商品收藏(<?php echo $itemCount; ?>)</div>
            
  			<?php  
                if($itemList)
                {
                	foreach($itemList as $product)
                	{                	
            ?>                   
            	<div class="colt_item">
                	<div class="colt_left">
                        <dl><dt><a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO, 'pid='.$product['id']);?>"><img src="<?php echo $product['pic_path'];?>" width="80" height="80" class="item_list_pic_product"/></a></dt></dl>
                  </div>
                	<div class="colt_right">
                	  <div class="colt_right_box">
                	  
						   <div class="colt_product_title">
							   <a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO, 'pid='.$product['id']);?>"><?php secho( $product['product_name'] ); ?></a> 
						   </div>
                        	<div class="colt_product">							
                            	<div class="point_box">
                                    <span class="score<?php echo getScoreClass($product['score']);?>"></span>
                                </div>
                                <h2>宝贝真实度</h2><h3><?php echo $product['reality'];?></h3>
                                <h2>性价比</h2><h3><?php echo $product['rate'];?></h3>
                                <h2>服务态度</h2><h3><?php echo $product['service'];?></h3>
                                <h2>发货速度</h2><h3><?php echo $product['velocity'];?></h3>
                        	</div>
                         	<div class="colt_product">							
								来自：<a href="<?php echo edp_href_link(PAGENAME_SHOP_INFO, 'sid='.$product['shop_id']);?>"><?php secho( $product['shop_name'] ); ?></a>
                        	</div>
                        	
                        	<div class="colt_product">							
  								 价格：<span><?php echo $product['price'];?></span>元	
                        	</div>                           
                            <div class="colt_product_edit">
                            	<h1><span>添加于 <?php echo  substr($product['collect_date'],0,10);?></span></h1>
                            	
                            	<h2><a href="<?php echo edp_href_link(PAGENAME_PRODUCT_INFO, 'pid='.$product['id'].'#ar');?>">发表点评</a></h2>
                            	
                            	
                            	<h2>
								<?php
									if($logid && $logid==$uid){
								?>
									<a name="<?php echo $product['id'].'_'.$product['product_name'];?>" class="modify_product" href="#">编辑</a>
								<?php
									}else{
								?>
									<a name="<?php echo $product['id'].'_'.$product['product_name'];?>" class="add_product" href="#">收藏</a>
								<?php 			
									}
								?>
								                            	
                            	</h2>
                            </div>
                      </div>
                  </div>
       		  </div>
       		  
		<?php  			
			}
         }
		?>						
          </div>
          
  <?php 
  			break;
		}
  
		 case '3':
	 	{
  ?>                  
          
		   <div class="colt_box" >
		   <div class="colt_title"><?php echo $user; ?>的评单收藏(<?php echo $itemCount; ?>)</div>
  			
  			<?php  
            
                if($itemList){
               	
                	foreach($itemList as $list){                	

            ?>  
		   
            	<div class="colt_item">
                	<div class="colt_left">
                        <dl>
                            <dt><a href="<?php echo edp_href_link(PAGENAME_LIST_INFO, 'lid='.$list['id']);?>"><img src="<?php echo $list['pic_path'];?>" width="80" height="80" class="item_list_pic_list"/></a></dt>                                                   
                        </dl>
                  </div>
                	<div class="colt_right">
                	  <div class="colt_right_box">
					   <div class="colt_list_title"><a href="<?php echo edp_href_link(PAGENAME_LIST_INFO, 'lid='.$list['id']);?>"><?php secho( $list['title'] ); ?></a></div>
                        	
							 <div class="colt_list"> 
							 <?php secho( $list['description'] ); ?>
									<span>(全部 <?php echo $list['c2c_count']; ?> 家店铺, <?php echo $list['b2c_count']; ?> 家商城, <?php echo $list['product_count']; ?> 件商品)</span>
                            </div>                         	                           
                            <div class="colt_list_edit">
                            	<h1><a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$list['user_id']);?>"><?php secho( $list['nick'] ); ?></a><span> 发表于 <?php echo substr($list['create_time'],0,10);?></span></h1>
                            	<h2>
								<?php
									if($logid && $logid==$uid){
								?>
									<a name="<?php echo $list['id'].'_'.$list['title'];?>" class="modify_list" href="#">编辑</a>
								<?php
									}else{
								?>
									<a name="<?php echo $list['id'].'_'.$list['title'];?>" class="add_list" href="#">收藏</a>
								<?php 
								  }
								?>                            	
                            	</h2>
                            </div>
                      </div>
                  </div>
       		  </div>
       		  
		<?php  			
			}}

		?>					
		
          </div>
   <?php 
   		
   			break;
		}

	}
  ?>             	
          
        <!--*************************************-->
        <div class="colt_bottomline"></div>
             <div class="pagebox">
             <?php echo $pageObj->getBar();  ?>
             </div>
      </div>
      
      
        <!--*************************************-->
      
        <div class="right_bar">
   
          <dl class="tag_box">
            	<dt>收藏标签</dt>
            	<dd><h1><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type);?>">全部</a></h1></dd>            	
            	
            	<?php
				if($tagList)
				{				
					$num = 0;
            		foreach($tagList as $index=>$t){
						
						echo '<dd><h1><a href="'.edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type.'&tag='.$t).'">'. $t .'('.$tagCount[$t].')</a></h1></dd>';		 
						$num++;							 
						if($num == 5)
						 	 break;					
					}
					
					if(count($tagList) > $num){
						
						$tagListHidden  = array_slice($tagList,$num);	
										
						echo '<span id="hiddenTag">';
						
	            		foreach($tagListHidden as $index=>$t){
							
							echo '<dd><h1><a href="'.edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type.'&tag='.$t).'">'. $t .'('.$tagCount[$t].')</a></h1></dd>';			
						}
							
						echo '</span>';	
						echo '<span id="btnShowTag" class="mr">显示更多</span>';
					}				
				?>               
          </dl>
          <?php 
				}	
			?>	

		  <dl class="cate_box">
            	<dt>收藏分类</dt>
                 <dd>
                	<h1><a href="<?php echo edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type);?>">全部</a></h1>                   
                </dd>           	
            	<?php
					if(isset($cateList)&&$cateList)
					{				
					$num = 0;
            		foreach($cateList as $index=>$cate){
						
						echo '<dd><h1><a href="'.edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type.'&cid='.$cate['id']).'">'. $cate['cate_name'] .'('.$cateCount[$cate['id']].')</a></h1></dd>';
									 
						 $num++;							 
						 if($num == 5)
						  break;					
					}					

					if(count($cateList) > $num){
						
						$cateListHidden  = array_slice($cateList,$num);	
										
						echo '<span id="hiddenCate">';
						
	            		foreach($cateListHidden as $index=>$cate){
							
							echo '<dd><h1><a href="'.edp_href_link(PAGENAME_USER_COLLECTION, 'uid='.$uid.'&type='.$type.'&cid='.$cate['id']).'">'. $cate['cate_name'] .'('.$cateCount[$cate['id']].')</a></h1></dd>';			
						}
							
						echo '</span>';	
						echo '<span id="btnShowCate" class="mr">显示更多</span>';
					}				
				?>    
                 
            </dl>
		  
		   <?php }	?>		
          
      </div>

<div id="CollectPopBox" style="display:none;cursor:default;" class="popup"></div>	